/*
 * @(#) WorkPlanService.java 2013-5-28 下午1:58:47
 *
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.im;

import java.util.Vector;

import pnuts.lang.Context;

import com.datasweep.compatibility.client.Equipment;
import com.datasweep.compatibility.client.EquipmentFilter;
import com.datasweep.compatibility.client.Response;
import com.datasweep.compatibility.pnuts.Functions;
import com.osi.mes.base.BaseService;

public class EquipmentService extends BaseService
{

	public EquipmentService(Context context)
	{
		super(context);
	}

	public EquipmentService(Functions functions)
	{
		super(functions);
	}
	
	@SuppressWarnings("unchecked")
	public Vector<Equipment> getEquipments(EquipmentFilter equipmentFilter)
	{
		return getFunctions().getFilteredEquipment(equipmentFilter);
	}
	
	public Response saveEquipment(Equipment equipment)
	{
		return equipment.save();
	}
	
	public Response deleteEquipment(Equipment equipment)
	{
		return equipment.delete(getFunctions().getDBTime(), null);
	}
}
